package com.javabaas.server.novel_server.chapter.controller;

import com.javabaas.server.novel_server.chapter.service.ChapterService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping(value = "/chapters")
public class ChapterController {

    @Autowired
    ChapterService service;

    /*
    * 获取书籍目录
    * */
    @RequestMapping(value = "/{bookId}", method = RequestMethod.GET)
    @ApiOperation(value = "获取书籍目录", notes = "获取某本书籍对应的目录")
    @ApiImplicitParam(name = "bookId", value = "书籍ID", required = true, dataType = "String", paramType = "path")
    public Object getChapters(@PathVariable String bookId) {
        return service.chapters(bookId);
    }


}
